package com.hisense.ovcloud.mqtt.business.dao;

import com.hisense.ovcloud.mqtt.business.config.Constants;
import com.hisense.ovcloud.mqtt.business.entity.ProductInfo;
import com.mybatisflex.core.datasource.DataSourceKey;
import org.springframework.stereotype.Component;

@Component
public class ProductDao {
    public ProductInfo findProductInfo(String domainId, String subDomainId) {
        DataSourceKey.use(Constants.DS.PRODUCT);
        return ProductInfo.model()
                .where(ProductInfo::getDomain).eq(domainId)
                .where(ProductInfo::getSubDomainId).eq(subDomainId)
                .one();
    }
}
